<?php
/**
 * 体质单模型
 * @authors xiadx (xiadx@zpdchina.com)
 * @date    2017-03-05 20:20:37
 * @version $Id$
 */

class DataTizhiPinggudanTemplateModel extends BaseModel {

	/**
     * 返回给终端的可执行sql语句的字段名称数组
     * @var [type]
     */
    public $_field_arr = ['id','xiangmu_name','hulicol_name','xiangmu_leixing','xiangmu_value','paixu','biaodan_name','biaodan_leibie','keshi','default_value','accept_char', 'input_type', 'xiangmu_value_save', 'reeditor_enable', 'show_zhuangtai','keyboardname'];

    /**
     * 【获取护理评估项目】
     * @param  [type] $query           [description]
     * @param  [type] $user_number     [description]
     * @param  [type] $user_department [description]
     * @return [type]                  [description]
     */
    public function tizhiPinggu($user_department)
    {
        $query = DB::select(implode(",", $this->_field_arr))
        			->from('data_tizhi_pinggudan_template')
        			->where('yiyuan_id', '=', $this->yiyuan_id)
        			->where('keshi', '=', $user_department)
        			->or_where('keshi', '=', '通用')
                    ->execute()
                    ->as_array();
	    return $query;
    }
}
